package ru.kipriz.todoly.api;

import ru.kipriz.todoly.api.entities.ErrorMessage;

/**
 * <p>Copyright: Copyright (c) 2010</p>
 *
 * @author Andrey Volkov
 *         <br/>Date: 3/24/11
 */
public class AccessDeniedException extends RuntimeException {
    ErrorMessage errorMessage;

    public AccessDeniedException(ErrorMessage errorMessage) {
        this(errorMessage.getErrorMessage());
        this.errorMessage = errorMessage;
    }

    public AccessDeniedException(String message) {
        super(message);
    }

    public AccessDeniedException(String message, Throwable cause) {
        super(message, cause);
    }

    public AccessDeniedException(Throwable cause) {
        super(cause);
    }

    public ErrorMessage getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(ErrorMessage errorMessage) {
        this.errorMessage = errorMessage;
    }
}
